<template>
  <view>
    <!-- <u-navbar height="-5" :is-back="true" title="修改密码" :background="background"></u-navbar> -->

    <view class="dowebok limiter" :style="winHeight">
      <view class="container-login100 bcImg" style="padding: 0 30rpx;" :style="winHeight">
        <view class="container-login100" style="padding: 0 30rpx;" :style="winHeight">
          <view class="logo">
            <u-image width="720" height="105" src="../../static/img/user/logo1.png"></u-image>
          </view>
          <view class="wrap-login100 p-b-30">
            <form class="login100-form">
              <view class="wrap-input100 validate-input m-b-10" data-validate="请输入用户名">
                <input class="input100" type="text" v-model="username" name="username" placeholder="用户名"
                  autocomplete="off">
                <span class="focus-input100"></span>
                <span class="symbol-input100">
                  <i class="fa fa-user"></i>
                </span>
              </view>

              <view class="wrap-input100 validate-input m-b-10" data-validate="请输入密码">
                <input class="input100" type="password" v-model="password" name="password" placeholder="密码">
                <span class="focus-input100"></span>
                <span class="symbol-input100">
                  <i class="fa fa-lock"></i>
                </span>
              </view>

              <view class="container-login100-form-btn p-t-10">
                <button class="login100-form-btn" @click="login()">登 录</button>
              </view>

            </form>
            <view class="footer">
              <text class="change" @click="change()">修改密码</text>
              <text class="forget">忘记密码</text>
            </view>

            <view>
              <u-toast ref="uToast" />
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        username: '',
        password: '',
        winHeight: {
          height: ''
        }
      }
    },
 
    onLoad() {

    },
    methods: {
      change() {
        uni.navigateTo({
          url: '/pages/user/changePassword'
        })
      },
      login() {
        var username = this.username;
        var password = this.password;


        if (username == '' || password == '') {
          this.$refs.uToast.show({
            title: '不能为空',
            type: 'warning'
          });
          return;
        } else if (password == '1111') {
          this.$refs.uToast.show({
            title: '登录成功',
            type: 'success',
            url: '/pages/index/index',
            isTab: true
          });

        } else {
          this.$refs.uToast.show({
            title: '登录失败',
            type: 'error'
          });
        }
      }
    }
  }
</script>

<style>
  @import url('../../static/css/main.css');
  @import url('../../static/css/util.css');
  @import url('http://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');

  .bcImg {
    background-image: url('../../static/img/user/bb.jpg');
  }
</style>
